Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / data / src / androidMain / kotlin / org / meshtastic / core / data / datasource / DeviceHardwareJsonDataSourceImpl.kt

Displaying Raw • Download

core/data/src/androidMain/kotlin/org/meshtastic/core/data/datasource/DeviceHardwareJsonDataSourceImpl.kt 953eef941e7b5e5335f2724cffd2dc1e4ad33107 (953eef94) Text, 1.76 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.data.datasource

Tff7b72import T7ee787android.app.Application
Tff7b72import T7ee787kotlinx.serialization.ExperimentalSerializationApi
Tff7b72import T7ee787kotlinx.serialization.json.Json
Tff7b72import T7ee787kotlinx.serialization.json.decodeFromStream
Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.core.model.NetworkDeviceHardware

Tf0883e@Single
Tff7b72class T56d364DeviceHardwareJsonDataSourceImplTb4b4b4(Tff7b72private Tff7b72val Te6edf3applicationTb4b4b4: Te6edf3ApplicationTb4b4b4) Tb4b4b4: Te6edf3DeviceHardwareJsonDataSource Tb4b4b4{

T8b949e// Use a tolerant JSON parser so that additional fields in the bundled asset
T8b949e// (e.g., "key") do not break deserialization on older app versions.
Tf0883e@OptInTb4b4b4(Te6edf3ExperimentalSerializationApiTff7b72::Te6edf3classTb4b4b4)
Tff7b72private Tff7b72val Te6edf3json Tff7b72= Te6edf3Json Tb4b4b4{
Te6edf3ignoreUnknownKeys Tff7b72= Tff7b72true
Te6edf3isLenient Tff7b72= Tff7b72true
Te6edf3exceptionsWithDebugInfo Tff7b72= Tff7b72false
Tb4b4b4}

Tf0883e@OptInTb4b4b4(Te6edf3ExperimentalSerializationApiTff7b72::Te6edf3classTb4b4b4)
Tff7b72override Tff7b72fun Td2a8ffloadDeviceHardwareFromJsonAssetTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3ListTff7b72<Te6edf3NetworkDeviceHardwareTff7b72> Tff7b72=
Te6edf3applicationTb4b4b4.Te6edf3assetsTb4b4b4.Te6edf3openTb4b4b4(Ta5d6ff"Ta5d6ffdevice_hardware.jsonTa5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3use Tb4b4b4{ Te6edf3inputStream Tff7b72-Tff7b72>
Te6edf3jsonTb4b4b4.Te6edf3decodeFromStreamTff7b72<Te6edf3ListTff7b72<Te6edf3NetworkDeviceHardwareTff7b72>Tff7b72>Tb4b4b4(Te6edf3inputStreamTb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.07s